/*
 *   The contents of this file are subject to the Mozilla Public License
 *   Version 1.1 (the "License"); you may not use this file except in
 *   compliance with the License. You may obtain a copy of the License at
 *   http://www.mozilla.org/MPL/
 *
 *   Software distributed under the License is distributed on an "AS IS"
 *   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 *   License for the specific language governing rights and limitations
 *   under the License.
 *
 *   The Original Code is OkkamNGWebServices, in the package org.okkam.webservice.*.
 *
 *   The Initial Developer of the Original Code is 
 *		Heiko Stoermer (http://www.know-who.net).
 *
 *   Portions created by the Initial Developer are Copyright (C) 2007
 *   the Initial Developer. All Rights Reserved.
 *
 *   Contributor(s): Daniel Giacomuzzi (etadaniel@gmail.com).
 *
*/
package org.okkam.webservice;


import org.okkam.core.api.EntitySearchNG;
import org.okkam.core.api.data.OkkamURIResult;


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

//import org.apache.axis.*;

/**
 * Business delegate from web services to Okkam Core. 
 * 
 * Provides for entity search. 
 * Returns an {@link org.okkam.core.api.data.OkkamURIResult}
 * 
 * @author stoermer
 */
public class SearchNG {
	
	private final static Log log = LogFactory.getLog(SearchNG.class);
	
	/**
	 * Empty constructor.
	 * 
	 */
	public SearchNG(){

	}

	/**
	 * Calls the search API of okkam core and returns an instance of {@link org.okkam.core.api.data.OkkamURIResult}.
	 * @param query String representation of {@link org.okkam.core.match.query.annotated.AnnotatedQuery}.
	 * @return {@link org.okkam.core.api.data.OkkamURIResult}
	 */
	public OkkamURIResult search(String query) {
		
		log.debug("search called. delegating.");
		EntitySearchNG esng = new EntitySearchNG();
		log.debug("delegation finished. returning.");
		return esng.search(query);
	}
}
